package SortAlgorithm;

public class ShellSort {
    public void shellSort(int[] array){
        for(int interval=array.length/2;interval>0;interval/=2){
            for(int i=interval;i<array.length;i++){
                int j=i-interval;
                int target=array[i];
                while(j>-1&&target>array[j]){
                    array[j+interval]=array[j];
                    j-=interval;
                }
                array[j+interval]=target;
            }
        }
    }
}